import http from "@/api/config/http";
import { IQuery } from "@/interface/IAxios";

// 查询角色列表
export function listRole(query?: IQuery): Promise<any> {
  return http.request({
    url: "/system/role/list",
    method: "get",
    params: query
  });
}
// 新增角色
export function addRole(data: any) {
  return http.request({
    url: "/system/role",
    method: "post",
    data
  });
}
// 删除角色
export function delRole(roleId: string[]) {
  return http.request({
    url: `/system/role/${roleId}`,
    method: "delete"
  });
}
// 修改角色
export function updateRole(data: any) {
  return http.request({
    url: "/system/role",
    method: "put",
    data
  });
}

// 查询角色详细
export function getRole(roleId: string) {
  return http.request({
    url: `/system/role/${roleId}`,
    method: "get"
  });
}
